package com.fiveGroup.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fiveGroup.mapper.UserFavoriteProductMapper;
import com.fiveGroup.pojo.UserFavoriteProduct;
import com.fiveGroup.pojo.vo.ProductFavoriteVo;
import com.fiveGroup.service.UserFavoriteProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 86188
 * @description 针对表【user_favorite_product(用户商品收藏表)】的数据库操作Service实现
 * @createDate 2025-09-26 15:01:12
 */
@Service
public class UserFavoriteProductServiceImpl extends ServiceImpl<UserFavoriteProductMapper, UserFavoriteProduct>
        implements UserFavoriteProductService {

    @Autowired
    private UserFavoriteProductMapper userFavoriteProductMapper;

    @Override
    public int getFavoriteCount(Long userId, Long productId) {
        return userFavoriteProductMapper.getFavoriteCount(userId, productId);
    }

    @Override
    public List<ProductFavoriteVo> getFavorite(IPage<ProductFavoriteVo> page, QueryWrapper<UserFavoriteProduct> queryWrapper) {
        return userFavoriteProductMapper.getFavorite(page, queryWrapper);
    }
}




